package com.ala4.oxcafe.boot;

import com.ala4.oxcafe.boot.filter.CachingContentFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author PING
 * @version 1.0
 * @date 2025/2/18 15:21
 */
@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean<CachingContentFilter> registerMyFilter() {
        FilterRegistrationBean<CachingContentFilter> bean = new FilterRegistrationBean<>();
        bean.setFilter(new CachingContentFilter());
        bean.addUrlPatterns("/*");
        bean.setOrder(Integer.MIN_VALUE); // 设置优先级
        return bean;
    }

}
